package pdfsetter.core.schema.advanced;

import pdfsetter.core.schema.PageSelection;

/**
 * AttachedFilePageSelection represents selection of pages from attached file. Having file and selection of pages we can produce {@link PageSelection} which
 * tells from which file we take which page.
 * 
 * @author Andrzej Dorobisz
 */
public class AttachedFilePageSelection {
    private final FilePageSelection filePageSelection;
    private final int fileNumber;

    public AttachedFilePageSelection(FilePageSelection filePageSelection, int fileNumber) {
        this.filePageSelection = filePageSelection;
        this.fileNumber = fileNumber;
    }

    public FilePageSelection getFilePageSelection() {
        return filePageSelection;
    }

    public int getFileNumber() {
        return fileNumber;
    }

    public PageSelection getPageSelection(int index) {
        return new PageSelection(fileNumber, filePageSelection.get(index));
    }
}
